/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidad;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author a
 */
@Entity
@Table(name = "deuda")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Deuda.findAll", query = "SELECT d FROM Deuda d"),
    @NamedQuery(name = "Deuda.findByIdDeuda", query = "SELECT d FROM Deuda d WHERE d.idDeuda = :idDeuda"),
    @NamedQuery(name = "Deuda.findByValorDeudado", query = "SELECT d FROM Deuda d WHERE d.valorDeudado = :valorDeudado"),
    @NamedQuery(name = "Deuda.findByFormaPago", query = "SELECT d FROM Deuda d WHERE d.formaPago LIKE :formaPago"),
    @NamedQuery(name = "Deuda.findByAbono", query = "SELECT d FROM Deuda d WHERE d.abono = :abono"),
    @NamedQuery(name = "Deuda.findByDescripcion", query = "SELECT d FROM Deuda d WHERE d.descripcion LIKE :descripcion"),
    @NamedQuery(name = "Deuda.findByActivo", query = "SELECT d FROM Deuda d WHERE d.activo = :activo")})
public class Deuda implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idDeuda")
    private Integer idDeuda;
    @Basic(optional = false)
    @Column(name = "valorDeudado")
    private float valorDeudado;
    @Column(name = "formaPago")
    private String formaPago;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "abono")
    private Float abono;
    @Column(name = "descripcion")
    private String descripcion;
    @Column(name = "activo")
    private Boolean activo;
    @JoinColumn(name = "orden_idOrden", referencedColumnName = "idOrden")
    @ManyToOne(optional = false)
    private Orden ordenidOrden;
    @JoinColumn(name = "Cliente_idCliente", referencedColumnName = "idCliente")
    @ManyToOne(optional = false)
    private Cliente clienteidCliente;

    public Deuda() {
    }

    public Deuda(Integer idDeuda) {
        this.idDeuda = idDeuda;
    }

    public Deuda(Integer idDeuda, float valorDeudado) {
        this.idDeuda = idDeuda;
        this.valorDeudado = valorDeudado;
    }

    public Integer getIdDeuda() {
        return idDeuda;
    }

    public void setIdDeuda(Integer idDeuda) {
        this.idDeuda = idDeuda;
    }

    public float getValorDeudado() {
        return valorDeudado;
    }

    public void setValorDeudado(float valorDeudado) {
        this.valorDeudado = valorDeudado;
    }

    public String getFormaPago() {
        return formaPago;
    }

    public void setFormaPago(String formaPago) {
        this.formaPago = formaPago;
    }

    public Float getAbono() {
        return abono;
    }

    public void setAbono(Float abono) {
        this.abono = abono;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public Boolean getActivo() {
        return activo;
    }

    public void setActivo(Boolean activo) {
        this.activo = activo;
    }

    public Orden getOrdenidOrden() {
        return ordenidOrden;
    }

    public void setOrdenidOrden(Orden ordenidOrden) {
        this.ordenidOrden = ordenidOrden;
    }

    public Cliente getClienteidCliente() {
        return clienteidCliente;
    }

    public void setClienteidCliente(Cliente clienteidCliente) {
        this.clienteidCliente = clienteidCliente;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDeuda != null ? idDeuda.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Deuda)) {
            return false;
        }
        Deuda other = (Deuda) object;
        if ((this.idDeuda == null && other.idDeuda != null) || (this.idDeuda != null && !this.idDeuda.equals(other.idDeuda))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidad.Deuda[ idDeuda=" + idDeuda + " ]";
    }
    
}
